/**
 * export命令
 */
export var firstName = 'Nichael';
export var lastName = 'Jackson';
export var year = 2017;
//或
var firstName = 'Nichael';
var lastName = 'Jackson';
var year = 2017;
export { firstName, lastName, year };
/**
 * 可以对输出的变量重命名
 */
function fun1() {}

function fun2() {}
export {
  fun1 as stream1,
  fun2 as stream2
}
/**
 * 综合上述三种写法
 */
//一
export var num = 1;
//二
var num = 1
export { num }
//三
var num = 1;
export { target as num }
/**
 * function 和 class的输出
 */
function fun1() {
  console.log(123)
}
export { fun1 }
//不能这样写
// export fun1
/**
 * export 命令不能处于块级作用域内
 */
//--------------------------------------------------------------
/**
 * 整体加载
 */
//circle.js
export function area(radius) {
  return Math.PI * radius * radius
}
export function circum(radius) {
  return 2 * Math.PI * radius
}
//逐个加载main.js
import { area cirnum } from './circle'
console.log(area(4))
console.log(cirnum(5))
  //整体加载
import * as circle from './circle'
console.log(circle.area(4))
console.log(circle.cirnum(5))